import Vue from 'vue'
import Vuex from 'vuex'
import countStore from './countStore'
// import stateStore from './stateStore'

Vue.use(Vuex)

export default new Vuex.Store({
  /* state: {
    count:0,
    countN:0
  },
  getters: {
    doubleCount(state){
      return state.count*2
    }
  },
  mutations: {
    increase(state){
      state.count++
    },
    decrease(state){
      state.count--
    },
    increaseByN(state,payload){
      state.countN+=payload
    },
    decreaseByN(state,payload){
      state.countN-=payload
    }
    
  },
  actions: {
    delayAdd(context){
      setTimeout(function(){
        context.commit('increase')
      },2000)
    },
    delayDec(context){
      setTimeout(() => {
        context.commit('decrease')
      }, 2000);
    }
  }, */
  modules: {
    countStore,
    // stateStore
  }
})
